using UnityEngine;
using System.Collections;

public class Nextbutton : MonoBehaviour {
	
	public HSController Controller;
	private bool mUsable;
	
	// Update is called once per frame
	void Update () 
	{
		if(Controller.offset + 10 > Controller.numberOfScore )
		{
			mUsable = false;
			guiText.material.color = Color.gray;
		}
		else
		{
			if(!mUsable)
				guiText.material.color = Color.white;
			
			mUsable = true;
		}
	}
	
	void OnMouseOver()
	{
		if(mUsable)
			guiText.material.color = Color.red;
		else
			guiText.material.color = Color.gray;
	}
	
	void OnMouseExit()
	{
		if(mUsable)
			guiText.material.color = Color.white;
		else
			guiText.material.color = Color.gray;
	}
	
	void OnMouseDown()
	{
		if(mUsable)
		{
			Controller.offset += 10;
			Controller.RetrieveScore();
		}
	}
}
